/*
* // +-------------------------------------------------------------------------------------------------
* // |                 有你就好 [ 有节骨乃坚，无心品自端 ]     <http://encoding.wang>
* // +-------------------------------------------------------------------------------------------------
* // |                             独在异乡为异客         每逢佳节倍思亲
* // +-------------------------------------------------------------------------------------------------
* // |                 联系:   <707069100@qq.com>      <http://weibo.com/513778937>
* // +-------------------------------------------------------------------------------------------------
*/

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                   ErYang出品 属于小极品          共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------


package wang.encoding.mroot.model.enums


/**
 * 文章分类类型枚举类
 *
 * @author ErYang
 */
enum class CategoryTypeEnum
constructor(

        /**
         * 得到 key
         *
         * @return Int
         */
        val key: Int,

        // -------------------------------------------------------------------------------------------------

        /**
         * 得到值
         *
         * @return String
         */
        val value: String) {


    /**
     * 主分类
     */
    FIRST(1, "主分类"),
    /**
     * 次级分类
     */
    SECOND(2, "次级分类"),
    /**
     * 分类
     */
    THIRD(3, "分类");

    // -------------------------------------------------------------------------------------------------

    companion object {

        /**
         * 根据 key 获取 value
         *
         * @param key key
         * @return String
         */
        fun getValueByKey(key: Int): String {
            val enums: Array<UserTypeEnum> = UserTypeEnum.values()
            return enums.indices
                    .firstOrNull { key == enums[it].key }
                    ?.let { enums[it].value }
                    ?: ""
        }

        // -------------------------------------------------------------------------------------------------

    }

    // -------------------------------------------------------------------------------------------------

}

// -----------------------------------------------------------------------------------------------------

// End CategoryTypeEnum enum

/* End of file CategoryTypeEnum.kt */
/* Location: ./src/main/kotlin/wang/encoding/mroot/model/enums/CategoryTypeEnum.kt */

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                           ErYang出品 属于小极品  O(∩_∩)O~~   共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------
